#include <stdio.h>
#include "ssd1306.h"
#include "ssd1306_sdk.h"

void Water_Ssd1306_Update(water_screen_type water_type, float water_data)
{
    char water_tx[25];
    switch (water_type)
    {
    case water_screen_water:
        sprintf(water_tx, "water:%.2fL\n", water_data);
        break;
    case water_screen_temp:
        sprintf(water_tx, "temp:%.2fC\n", water_data);
        break;
    case water_screen_TDS:
        sprintf(water_tx, "TDS:%.2fppm\n", water_data);
        break;
    case water_screen_Hydraulic:
        sprintf(water_tx, "Hydraulic:\n");
        break;
    default:
        break;
    }
    ssd1306_SetCursor(0, 10 * water_type);
    ssd1306_DrawString(water_tx, Font_7x10, White);
    ssd1306_UpdateScreen();
    if (water_type == water_screen_Hydraulic)
    {
        sprintf(water_tx, "%.2fKpa", water_data);
        ssd1306_SetCursor(0, 10 * water_type + 10);
        ssd1306_DrawString(water_tx, Font_7x10, White);
        ssd1306_UpdateScreen();
    }
    usleep(10);
}